<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
  </head>
  <body>
    <div id="app" style="width: 300px; height: 300px; background-color: burlywood; padding: 10px;">
      <lk-box  @father-func = "fatherFunc1"></lk-box>
    </div>
    <template id="box">
      <div style="width: 200px; height: 200px; background-color: blueviolet;">
        <button @click="clickMe">点我</button>        
      </div>
    </template>
    <script src="../js/vue.js"></script>

    <script>
      //子组件
      const Box = {
        template:"#box",
        methods:{
          clickMe(){
            console.log('我是子组件');
            this.$emit('fatherFunc',...[1,2,3,4]);//自定义事件
            
          }
        }

      };
      const app = Vue.createApp({
        data() {
          return {
            msg: ""
          }
        },
        components:{
          'lk-box':Box
        },
        methods: {
          fatherFunc1(...args){
            console.log('我是父组件');
            console.log(args);
          }
        },
      }).mount("#app");
    </script>
  </body>
</html>